from sqlalchemy import create_engine
import psycopg2
import json
import os



# 寻找配置
systemConfig = json.load(open(os.getcwd() + "/sysConfig/config.json", 'r', encoding="utf-8"))
pathConf = systemConfig


# 缓存的资源存放路径
res_path_conf=systemConfig['res_path_conf']
# 缓存的资源有效时长
# resourceValidityTime01=86600000
resourceValidityTime01=systemConfig['resourceValidityTime01']


# 启动端口
exePort=systemConfig['exePort']


# Postgis数据库连接
# engine = create_engine('postgresql://postgres:O0O00O0O@localhost:5432/postgisDemo01')
engine= create_engine(systemConfig['PGUrl'])
# conn = psycopg2.connect(database="postgisDemo01", user="postgres", password="O0O00O0O", host="localhost", port="5432")
conn = psycopg2.connect(database=systemConfig['PG_database'], user=systemConfig['PG_user'], password=systemConfig['PG_password'], host=systemConfig['PG_host'], port=systemConfig['PG_port'])


# GDAL参数配置
# shpSieveFiltertThreshold tif去碎片的最大删除片数
shpSieveFiltertThreshold=systemConfig['shpSieveFiltertThreshold']
# shpSieveFiltertconnectedness tif去碎片的联通方式，4斜着不相连，8斜着相连
shpSieveFiltertConnectedness=systemConfig['shpSieveFiltertConnectedness']
